#include <stdio.h>

int gcd(m, n);
main()
{
	int a, b, c, g;
	printf("Input three integers.\n");
	scanf("%d%d%d",&a,&b,&c);
	g = gcd(a, b);
	g = gcd(g, c);
	printf("gcd=%d\n",g);
}

int gcd(m, n)
//int m, n;
{
	int r;
	while(n != 0)
	{
		r = m % n;
		m = n;
		n = r;
	}
	return (m);
}